# Create your views here.
from risk.models import *
from risk.serializers import *
from dvadmin.utils.viewset import CustomModelViewSet


class AnjianViewSet(CustomModelViewSet):
    """
    list:查询
    create:新增
    update:修改
    retrieve:单例
    destroy:删除
    """
    queryset = Anjian.objects.all()
    serializer_class = AnjianSerializer
    create_serializer_class = AnjianCreateUpdateSerializer
    update_serializer_class = AnjianCreateUpdateSerializer
    filter_fields = ["案件所属系统", "案件编号", "案件名称", "案由", "案值_万元_field", "当事人", "当事人类型",
                     "身份证号", "注册号", "性别", "法人", "职业", "地址", "工作单位", "居所", "立案日期", "案发日期",
                     "案发地", "主要发案区域", "立案机关", "办案机构", "违法行为种类", "案件认定事实",
                     "非法所得_万元_field", "作出处理决定日期", "处罚书文号", "处罚种类", "处罚决定书送达日期",
                     "定性依据", "处罚依据", "执法人员", "主办人", "罚款金额_万元_field", "没收金额_万元_field",
                     "罚没入库金额_万元_field", "案件处理类型", "案件状态", "案件类别", "结案日期", "适用程序",
                     "专项工作", "是否四个最严案件"]
    search_fields = ['当事人', '主要发案区域', '案件状态', '案件类别']
